<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>屏蔽键盘所有键</title>
    <script type="text/javascript" language="JavaScript">
        // 重写文档的按键事件
        function document.onkeydown(){
            event.keyCode = 0;          //忽略所有键
            event.returnvalue = false;  //不执行按键操作
        }
    </script>
</head>
<body>
<input type=text name="txt1" value="">
</body>
</html>